Skip to content

Conversation

@leftybournes
Copy link
Contributor

No description provided.

@leftybournes leftybournes force-pushed the leftybournes/fix/stable29-backports branch from e7af913 to 8089fab Compare December 18, 2025 07:29
Signed-off-by: Kent Delante <[email protected]>
@leftybournes leftybournes force-pushed the leftybournes/fix/stable29-backports branch from 8f6158a to 1a58a72 Compare December 19, 2025 05:14
@leftybournes leftybournes force-pushed the leftybournes/fix/stable29-backports branch from 1a58a72 to 32cb3bb Compare December 19, 2025 05:28
@icewind1991
Copy link
Member

I'm not sure if a move command like this is the correct option. (Only setting the stored instance, not moving an actual object). Or if we want to extend https://github.com/nextcloud/multibucket_migrate instead, which does perform the object moving.

@icewind1991
Copy link
Member

Outside of the move command the changes look good

Signed-off-by: Kent Delante <[email protected]>
@leftybournes leftybournes force-pushed the leftybournes/fix/stable29-backports branch from 6b1a26e to fc30176 Compare December 23, 2025 07:39
@leftybournes
Copy link
Contributor Author

I'm not sure if a move command like this is the correct option. (Only setting the stored instance, not moving an actual object). Or if we want to extend https://github.com/nextcloud/multibucket_migrate instead, which does perform the object moving.

I think extending multibucket_migrate is the way to go since that's already available instead of adding the move command.

->from('filecache')
->where($query->expr()->eq('storage', $query->createNamedParameter($storageId, IQueryBuilder::PARAM_INT)))
->andWhere($query->expr()->neq('mimetype', $query->createNamedParameter($folderMimetype, IQueryBuilder::PARAM_INT)));
$result = $query->execute();

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\DB\QueryBuilder\IQueryBuilder::execute has been marked as deprecated
->where($query->expr()->eq('storage', $query->createNamedParameter($storageId, IQueryBuilder::PARAM_INT)))
->andWhere($query->expr()->neq('mimetype', $query->createNamedParameter($folderMimetype, IQueryBuilder::PARAM_INT)));
$result = $query->execute();
$fileIds = $result->fetchAll(\PDO::FETCH_COLUMN);

Check notice

Code scanning / Psalm

PossiblyInvalidMethodCall Note

Cannot call method on possible int variable $result
@leftybournes leftybournes force-pushed the leftybournes/fix/stable29-backports branch from a3fbe3d to 84f7093 Compare January 9, 2026 07:59
Copy link
Member

@icewind1991 icewind1991 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from changing it to only verify a small number of objects for the move command this looks good to go

@leftybournes leftybournes force-pushed the leftybournes/fix/stable29-backports branch from 84f7093 to cd1d630 Compare January 12, 2026 08:16
@icewind1991
Copy link
Member

In general, I would suggest throwing exceptions in validateForUser for anything but the expected "object not found" error to prevent confusing users with an error message that doesn't match the error.

@leftybournes leftybournes force-pushed the leftybournes/fix/stable29-backports branch 2 times, most recently from 440a4e5 to ef7e00d Compare January 12, 2026 12:38
@leftybournes leftybournes force-pushed the leftybournes/fix/stable29-backports branch from ef7e00d to 7415781 Compare January 12, 2026 12:42

$homeStorage = $homeMount->getStorage();
$storageId = $homeStorage?->getCache()->getNumericStorageId();
if ($storageId === null) {

Check notice

Code scanning / Psalm

DocblockTypeContradiction Note

int does not contain null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants